from common.mysql.MySQLhelper import get_sql_helper

sqlhelper = get_sql_helper()

# 注：现在还不完善，所有的数据还未替换完成
# 1.替换标签相关的旧数据
def update_old_tag_data(today, user_id, old_user_id):
    # 将用户-标签替换掉
    sqlhelper.update(
        "UPDATE shequn_user_tag SET update_by = %s, update_time = %s, user_id = %s WHERE user_id = %s; ",
        ("admin", today, user_id, old_user_id))

def insert_user_tag_byId(id01, today, user_id, tag_id):
    sqlhelper.insert_one(
        "INSERT INTO shequn_user_tag (id, create_by, create_time, update_by, update_time, user_id, tag_id) VALUES(%s, %s, %s, %s, %s, %s, %s); ",
        (id01, 'admin', today, 'admin', today, user_id, tag_id))
